import { getTemplateConfig } from '../config/template';

const defaultTintColor = '#FFB32E';
const defaultDrakTintColor = '#FED530';

const templateConfig = getTemplateConfig();

const tintColor = (templateConfig && templateConfig.app
  && templateConfig.app.color && templateConfig.app.color.tintColor) || defaultTintColor;

const drakTintColor = (templateConfig && templateConfig.app
  // eslint-disable-next-line max-len
  && templateConfig.app.darkColor && templateConfig.app.darkColor.tintColor) || defaultDrakTintColor;

interface IColors {
  tintColor: string;
  tabIconDefault: string;
  tabIconSelected: string;
  tabBar: string;
  errorBackground: string;
  errorText: string;
  warningBackground: string;
  warningText: string;
  noticeBackground: string;
  noticeText: string;
  extraGary: string;
  screenBackground: string;
  deleteButton: string;
  alertColor: string;
  faultColor: string;
  warnColor: string;
  notifiColor: string;

  normalBackgroundColor: string;
  cardBackgroundColor: string;
  screenBackgroundGaryColor: string;
  normalTextColor: string;
  normalTextGaryColor: string;
  borderBottomColor: string;
  titleTextColor: string;
  maskColor: string;
  navBarColor: string;
  subTitleTextColor: string;
  networkColor: string;
  stepColor: string;
}

const fontSize = {
  title: 30,
  deviceState: 26,
  pageTitle: 24,
  blockTitle: 18,
  text: 15,
  subText: 13,
  smallText: 12
};

const lightColors = {
  appTheme: 'light',
  tintColor,
  tabIconDefault: '#ccc',
  tabIconSelected: tintColor,
  tabBar: '#fefefe',
  errorBackground: 'red',
  errorText: '#fff',
  warningBackground: '#EAEB5E',
  warningText: '#666804',
  noticeBackground: tintColor,
  noticeText: '#fff',
  extraGary: '#888',
  screenBackground: '#f3f3f3',
  deleteButton: '#f94e51',
  alertColor: '#f33f41',
  faultColor: '#f25e20',
  warnColor: '#ffb245',
  notifiColor: '#1dbc76',

  normalBackgroundColor: '#fff',
  cardBackgroundColor: '#fff',
  screenBackgroundGaryColor: '#f7f7f7',
  normalTextColor: '#000000',
  normalTextGaryColor: '#9a9a9a',
  borderBottomColor: '#f3f3f3',
  titleTextColor: '#333333',
  subTitleTextColor: '#666',
  maskColor: 'rgba(0,0,0,0.5)',
  navBarColor: '#ffffff',
  navTitleColor: '#000',
  fontSize,
  frontColor: '#000000',
  networkColor: '#1989FA',
  stepColor: '#fff',
};

const drakColors = {
  appTheme: 'dark',
  tintColor: drakTintColor,
  tabIconDefault: '#999',
  tabIconSelected: drakTintColor,
  tabBar: '#333',
  errorBackground: 'red',
  errorText: '#fff',
  warningBackground: '#EAEB5E',
  warningText: '#666804',
  noticeBackground: drakTintColor,
  noticeText: '#fff',
  extraGary: '#888',
  screenBackground: '#000',
  deleteButton: '#f94e51',
  alertColor: '#f33f41',
  faultColor: '#f25e20',
  warnColor: '#ffb245',
  notifiColor: '#1dbc76',

  normalBackgroundColor: '#191919',
  cardBackgroundColor: '#232323',
  screenBackgroundGaryColor: '#191919',
  normalTextColor: '#E8E8E8',
  normalTextGaryColor: '#999',
  borderBottomColor: '#2e2e2e',
  titleTextColor: '#E8E8E8',
  subTitleTextColor: '#cccccc',
  maskColor: 'rgba(0,0,0,0.5)',
  navBarColor: '#232323',
  navTitleColor: '#f3f3f3',
  fontSize,
  frontColor: '#ffffff',
  networkColor: '#1989FA',
  stepColor: '#000',
};

export {
  lightColors,
  drakColors,
};

export default lightColors as IColors;
